//********************************************************************
// 
//  file:  WindowUploadSample.cs
// 
//  (C) Copyright 2010, Diomede Corporation
//  All rights reserved
// 
//  Use, modification, and distribution is subject to   
//  the New BSD License (See accompanying file license.txt).
// 
//********************************************************************

using System;
using System.Collections.Generic;
using System.Text;

namespace Diomede.SDK.Example.Samples.Files
{
    public class WindowUploadSample
    {
        public void Start()
        {
            ISession session = new Session();
            string username = string.Format("unittestc{0}", DateTime.Now.Ticks);
            string password = "password914";

            string email = string.Format("{0}@email.com", username);
            IAccountManagement accountManagement = session as IAccountManagement;
            accountManagement.Create(username, password, email);

            if (session.Login(username, password).Status != Diomede.SDK.Enums.ExecutionResults.Success)
            {
                Utils.WriteError("Fail to login to Diomede Storage Service, please check your settings.");
                return;
            }

            IFileManagement fMngt = session as IFileManagement;
            fMngt.OpenUploadWindow(true);

        }
    }
}
